//
//  TravelTourBtnTipsViewController.m
//  ToWhere
//
//  Created by dllo on 15/11/21.
//  Copyright © 2015年 www.TE.com. All rights reserved.
//

#import "TravelTourBtnTipsViewController.h"

@interface TravelTourBtnTipsViewController ()<UIWebViewDelegate,UIScrollViewDelegate>

@property (nonatomic, retain) UIWebView *webView;

@end

@implementation TravelTourBtnTipsViewController

-(void)dealloc
{
    [_webView release];
    [_strTips release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 60*kHeight , self.view.frame.size.width, self.view.frame.size.height -60 * kHeight)];
    self.webView.scrollView.delegate = self;
    self.webView.delegate = self;
    self.webView.scrollView.bounces = NO;
    self.webView.opaque = NO;
    self.webView.backgroundColor = [UIColor colorWithWhite:0.162 alpha:1.000];
    [self.webView loadHTMLString:self.strTips baseURL:nil];
    [self.view addSubview:self.webView];

    self.view.backgroundColor = [UIColor blackColor];
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(10*kWidth, 30 *kHeight, 30*kWidth, 20 *kHeight);
    [btn addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
    [btn setImage:[UIImage imageNamed:@"Food_back"] forState:UIControlStateNormal];
//    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
//    [btn setTitle:@"返回" forState:UIControlStateNormal];
//    
    
    
    [self.view addSubview:btn];
    [self.webView release];
    
    // Do any additional setup after loading the view.
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    
    [webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= 'white'"];
    
}



-(void)btnAction
{
    [self dismissViewControllerAnimated:YES completion:nil];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
